package View;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.JButton;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ViewTcc extends JFrame {

	private static JFrame janela;
	private JPanel contentPane;
	private JTextField txtAutor;
	private JTextField txtTitulo;
	private JTextField txtPaginas;
	private JTextField txtOrientador;
	private JTextField txtCod;

	/**
	 * Launch the application.
	 */
	public void iniciar() {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					CadastroAluno frame = new CadastroAluno();
					
					janela.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	/**
	 * Create the frame.
	 */
	public ViewTcc() {
		getContentPane().setLayout(null);
		
		JLabel lblCodigo = new JLabel("Codigo");
		lblCodigo.setBounds(23, 31, 46, 14);
		getContentPane().add(lblCodigo);
		
		JLabel lblAutor = new JLabel("Autor");
		lblAutor.setBounds(218, 31, 46, 14);
		getContentPane().add(lblAutor);
		janela =new JFrame ("Cadastro Obra");
		janela.setSize(600,400);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		janela.setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("Autor");
		lblNewLabel.setBounds(232, 27, 46, 14);
		contentPane.add(lblNewLabel);
		
		txtAutor = new JTextField();
		txtAutor.setBounds(278, 24, 86, 20);
		contentPane.add(txtAutor);
		txtAutor.setColumns(10);
		
		JLabel lblTitulo = new JLabel("Titulo");
		lblTitulo.setBounds(22, 75, 46, 14);
		contentPane.add(lblTitulo);
		
		txtTitulo = new JTextField();
		txtTitulo.setBounds(78, 72, 86, 20);
		contentPane.add(txtTitulo);
		txtTitulo.setColumns(10);
		
		JComboBox cbCurso = new JComboBox();
		cbCurso.setBounds(302, 137, 86, 20);
		contentPane.add(cbCurso);
		cbCurso.addItem("");
		cbCurso.addItem("ADS");
		cbCurso.addItem("Logistica");
		cbCurso.addItem("comex");
		cbCurso.addItem("Polimeros");
		
		
		JLabel lblCurso = new JLabel("Curso");
		lblCurso.setBounds(232, 140, 46, 14);
		contentPane.add(lblCurso);
		
		JLabel lblNpaginas = new JLabel("N\u00BApaginas");
		lblNpaginas.setBounds(229, 90, 70, 14);
		contentPane.add(lblNpaginas);
		
		txtPaginas = new JTextField();
		txtPaginas.setBounds(302, 87, 86, 20);
		contentPane.add(txtPaginas);
		txtPaginas.setColumns(10);
		
		JLabel lblOrientador = new JLabel("Orientador");
		lblOrientador.setBounds(22, 143, 70, 14);
		contentPane.add(lblOrientador);
		
		txtOrientador = new JTextField();
		txtOrientador.setBounds(102, 140, 86, 20);
		contentPane.add(txtOrientador);
		txtOrientador.setColumns(10);
		
		JButton btnAdicionar = new JButton("Adicionar");
		btnAdicionar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		btnAdicionar.setBounds(22, 212, 89, 23);
		contentPane.add(btnAdicionar);
		
		
		
		txtCod = new JTextField();
		txtCod.setEnabled(false);
		txtCod.setBounds(78, 24, 86, 20);
		contentPane.add(txtCod);
		txtCod.setColumns(10);
		
		JButton btnRemover = new JButton("Remover");
		
		btnRemover.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				txtCod.setEnabled(true);
			}
		});
		btnRemover.setBounds(133, 212, 89, 23);
		contentPane.add(btnRemover);
		
		JButton btnPesquisar = new JButton("Pesquisar");
		btnPesquisar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				txtCod.setEnabled(true);
			}
		});
		btnPesquisar.setBounds(232, 212, 89, 23);
		contentPane.add(btnPesquisar);
		
		JButton btnAlterar = new JButton("Alterar");
		btnAlterar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				txtCod.setEnabled(true);
			}
		});
		btnAlterar.setBounds(345, 212, 89, 23);
		contentPane.add(btnAlterar);
		
		JLabel lblCod = new JLabel("Cod.");
		lblCod.setBounds(22, 27, 46, 14);
		contentPane.add(lblCod);
	}
}
